﻿using System;
using System.Collections.Generic;
using System.Text;
using EnvDTE;
using EnvDTE80;
using Microsoft.VisualStudio.CommandBars;

namespace TFSPlus
{
    public class TestCmd : IDTCommandTarget
    {
        internal void UISetup(DTE2 applicationObject, AddIn addInInstance, Commands2 commands, object[] contextGUIDS)
        {
            Command findFileCommand = commands.AddNamedCommand2(addInInstance, "FindFileInTFSExplorer", "Find File in TFS Explorer", "Navigates to this file in the TFS Explorer window", true, 59, ref contextGUIDS, (int)vsCommandStatus.vsCommandStatusSupported + (int)vsCommandStatus.vsCommandStatusEnabled, (int)vsCommandStyle.vsCommandStylePictAndText, vsCommandControlType.vsCommandControlTypeButton);

            // Add a command to the Item shortcut menu.
            CommandBar fileCmdBar = ((CommandBars)applicationObject.CommandBars)["File"];
            CommandBarControl fileShortcutCtrl = (CommandBarControl)findFileCommand.AddControl(fileCmdBar, fileCmdBar.Controls.Count + 1);
            fileShortcutCtrl.Caption = "Find file in Source Control Explorer";
        }

        #region IDTCommandTarget Members

        public void QueryStatus(string CmdName, vsCommandStatusTextWanted NeededText, ref vsCommandStatus StatusOption, ref object CommandText)
        {

        }

        public void Exec(string CmdName, vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
        {
            
        }


        #endregion
    }
}
